<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html;charset=gb2312">
    <title>webGL-01</title>
    <script>
        var webgl = null
        window.onload = function  Init(){
            var canvas = document.getElementById('myCanvas')
            webgl = canvas.getContext('webgl') // 创建openGl 上下文
            webgl.viewport(0, 0, canvas.clientWidth, canvas.clientHeight)
            webgl.clearColor(0.70, 0.39, 0.0, 0.5)
            webgl.clear(webgl.COLOR_BUFFER_BIT)
        }
    </script>
    <style>
        .panel{
            border: solid 2px palevioletred;
            width: 600px;
            height: 450px;
        }
    </style>
</head>
<body>
    <canvas id="myCanvas" class="panel"></canvas>
</body>
</html>